<?php
namespace Home\Controller;
use Think\Controller;
use Common\Lib\SessionLib;
/**
 *  Index
 */
class IndexController extends Controller{
	/**
	 * index
	 */
	public function index(){
		echo 'C(SMS_SIGNNAME)';exit;
		cookie('user','hongweizhiyuan1');
		echo "index";
		exit;

	}

	public function testsession(){
		echo cookie('user');
	}

	//encrypt加密
	//输出：fnunqn6ldamueHnYfoGk1pqTf6HIqnFw
	public function encrypt(){
		$code = \Think\Crypt::encrypt('pikaapp',md5('2016pika'));
		echo $code;
	}

	//decrypt解密
	//输出：pikaapp
	public function decrypt(){
		$code = \Think\Crypt::decrypt('fnunqn6ldamueHnYfoGk1pqTf6HIqnFw',md5('2016pika'));
		echo $code;
	}

	/**
	 * session test
	 * 输出：f3am2rB1eNyxdKevfqiXaMS3yGuUgHnOtHjMn5Bsu6qArKaUxoib0L1i0mmSqKdnpreqZoKMhN60nqljhn3Idg
	 */
	public function sessiontest(){
		$newsessid = SessionLib::init('App');
		echo $newsessid;
	}
}